'''PyQt4 designer的用法:用批处理把.ui文件编译成.py.批处理只需要一句:
@python.exe -c"import PyQt4.uic.pyuic" %1 -o %1.py .然后在另一个文件中import该文件
的类,并新建一个QMainWindow,用ui去setup该QMainWindow.文件一般为:项目名_ui.py,项目名_window.py
具体看本文件夹的clockcountdown_ui.py与clockcountdown_window.py.一般来说,生成的ui文件不需要修改,
这里为了各种实验稍稍改了一些.注意python3.x版本后全是utf8编码,什么fromUtf8可以省略.'''

from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(198, 335)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.tabWidget = QtGui.QTabWidget(self.centralwidget)
        self.tabWidget.setGeometry(QtCore.QRect(10, 30, 151, 241))
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.clock = QtGui.QWidget()
        self.clock.setObjectName(_fromUtf8("clock"))
        self.label_2 = QtGui.QLabel(self.clock)
        self.label_2.setGeometry(QtCore.QRect(20, 10, 61, 16))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.time_lb = QtGui.QLabel(self.clock)
        self.time_lb.setGeometry(QtCore.QRect(90, 10, 131, 16))
        self.time_lb.setText(_fromUtf8(""))
        self.time_lb.setObjectName(_fromUtf8("time_lb"))
        self.alarmset_pb = QtGui.QPushButton(self.clock)
        self.alarmset_pb.setGeometry(QtCore.QRect(20, 40, 95, 23))
        self.alarmset_pb.setObjectName(_fromUtf8("alarmset_pb"))
        self.alarmhour_sb = QtGui.QSpinBox(self.clock)
        self.alarmhour_sb.setGeometry(QtCore.QRect(20, 70, 42, 22))
        self.alarmhour_sb.setMaximum(23)
        self.alarmhour_sb.setObjectName(_fromUtf8("alarmhour_sb"))
        self.label_3 = QtGui.QLabel(self.clock)
        self.label_3.setGeometry(QtCore.QRect(70, 70, 31, 16))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.alarmminute_sb = QtGui.QSpinBox(self.clock)
        self.alarmminute_sb.setGeometry(QtCore.QRect(20, 100, 42, 22))
        self.alarmminute_sb.setMaximum(59)
        self.alarmminute_sb.setObjectName(_fromUtf8("alarmminute_sb"))
        self.label_4 = QtGui.QLabel(self.clock)
        self.label_4.setGeometry(QtCore.QRect(70, 100, 16, 16))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.alarmsecond_sb = QtGui.QSpinBox(self.clock)
        self.alarmsecond_sb.setGeometry(QtCore.QRect(20, 130, 42, 22))
        self.alarmsecond_sb.setMaximum(59)
        self.alarmsecond_sb.setObjectName(_fromUtf8("alarmsecond_sb"))
        self.label_5 = QtGui.QLabel(self.clock)
        self.label_5.setGeometry(QtCore.QRect(70, 130, 21, 16))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.label_6 = QtGui.QLabel(self.clock)
        self.label_6.setGeometry(QtCore.QRect(20, 160, 54, 12))
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.alarmmessage_le = QtGui.QLineEdit(self.clock)
        self.alarmmessage_le.setGeometry(QtCore.QRect(20, 180, 113, 20))
        self.alarmmessage_le.setObjectName(_fromUtf8("alarmmessage_le"))
        self.tabWidget.addTab(self.clock, _fromUtf8(""))
        self.countdown = QtGui.QWidget()
        self.countdown.setObjectName(_fromUtf8("countdown"))
        self.comboBox = QtGui.QComboBox(self.countdown)
        self.comboBox.setGeometry(QtCore.QRect(10, 80, 111, 22))
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.label_7 = QtGui.QLabel(self.countdown)
        self.label_7.setGeometry(QtCore.QRect(10, 10, 81, 16))
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.countdownset_pb = QtGui.QPushButton(self.countdown)
        self.countdownset_pb.setGeometry(QtCore.QRect(10, 50, 95, 23))
        self.countdownset_pb.setObjectName(_fromUtf8("countdownset_pb"))
        self.label_8 = QtGui.QLabel(self.countdown)
        self.label_8.setGeometry(QtCore.QRect(10, 30, 61, 16))
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.countdownshow_lb = QtGui.QLabel(self.countdown)
        self.countdownshow_lb.setGeometry(QtCore.QRect(70, 30, 54, 12))
        self.countdownshow_lb.setText(_fromUtf8(""))
        self.countdownshow_lb.setObjectName(_fromUtf8("countdownshow_lb"))
        self.tabWidget.addTab(self.countdown, _fromUtf8(""))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(10, 10, 161, 16))
        self.label.setObjectName(_fromUtf8("label"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 198, 23))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menu = QtGui.QMenu(self.menubar)
        self.menu.setObjectName(_fromUtf8("menu"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.action = QtGui.QAction(MainWindow)
        self.action.setObjectName(_fromUtf8("action"))
        #self.action_2 = QtGui.QAction(MainWindow)
        #self.action_2.setObjectName(_fromUtf8("action_2"))
        self.menu.addAction(self.action)
        #self.menu.addAction(self.action_2)
        self.menubar.addAction(self.menu.menuAction())

        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(1)
        QtCore.QObject.connect(self.alarmset_pb, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.alarm_click)
        QtCore.QObject.connect(self.countdownset_pb, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.countdown_click)
        QtCore.QObject.connect(self.menubar, QtCore.SIGNAL(_fromUtf8("triggered(QAction*)")), MainWindow.menu_exit)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "闹钟+倒计时", None))
        self.label_2.setText(_translate("MainWindow", "当前时间 = ", None))
        self.alarmset_pb.setText(_translate("MainWindow", "开始或中止闹钟", None))
        self.label_3.setText(_translate("MainWindow", "时", None))
        self.label_4.setText(_translate("MainWindow", "分", None))
        self.label_5.setText(_translate("MainWindow", "秒", None))
        self.label_6.setText(_translate("MainWindow", "提示信息", None))
        self.alarmmessage_le.setText(_translate("MainWindow", "闹钟提示", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.clock), _translate("MainWindow", "clock", None))
        self.comboBox.setItemText(0, _translate("MainWindow", "10", None))
        self.comboBox.setItemText(1, _translate("MainWindow", "30", None))
        self.comboBox.setItemText(2, _translate("MainWindow", "60", None))
        self.comboBox.setItemText(3, _translate("MainWindow", "300", None))
        self.comboBox.setItemText(4, _translate("MainWindow", "900", None))
        self.comboBox.setItemText(5, _translate("MainWindow", "1800", None))
        self.comboBox.setItemText(6, _translate("MainWindow", "3600", None))
        self.label_7.setText(_translate("MainWindow", "设置倒数秒数", None))
        self.countdownset_pb.setText(_translate("MainWindow", "开始或中止倒数", None))
        self.label_8.setText(_translate("MainWindow", "剩余秒数:", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.countdown), _translate("MainWindow", "countdown", None))
        self.label.setText(_translate("MainWindow", "PyQt4 Example", None))
        self.menu.setTitle(_translate("MainWindow", "文件", None))
        self.action.setText(_translate("MainWindow", "退出", None))
        #self.action_2.setText(_translate("MainWindow", "退出", None))

